package mipushdemo.xiaomi.com.diyitonghang.presenter.impl.loginimpl;

import java.util.List;

import mipushdemo.xiaomi.com.diyitonghang.data.bean.NewsChannelData;
import mipushdemo.xiaomi.com.diyitonghang.model.imodel.loginmodel.IHomeModel;
import mipushdemo.xiaomi.com.diyitonghang.model.impl.loginimpl.HomeModelImpl;
import mipushdemo.xiaomi.com.diyitonghang.presenter.contract.homecontract.IHomeContract;

public class HomePresenterImpl implements IHomeContract.IHomePresenter {
    IHomeContract.IHomeView iHomeView;
    private final IHomeModel homeModel;

    public HomePresenterImpl(IHomeContract.IHomeView iHomeView) {
        this.iHomeView = iHomeView;
        iHomeView.setPresenter(this);
        homeModel = new HomeModelImpl();
    }

    @Override
    public void login(String header) {
        homeModel.responseDataMa(header,new IHomeModel.SetOnDataChangedListener() {
            @Override
            public void setOnData(List<NewsChannelData.DataBean.NewsChannelListBean> newsChannelList) {
                iHomeView.showData(newsChannelList);
            }
        });
    }
}
